﻿using AutoMapper;
using Common.Communal;
using MediatR;
using Sell.Api.Write.Application.Command.Pro;
using Sell.Services.Pro;

namespace Sell.Api.Write.Application.CommandHandlers.Pro
{
    public class FlowDelCommandHandlers : IRequestHandler<FlowDelCommand, ApiResult<int>>
    {
        public IMapper Mapper { get; }
        public IFlowServices services { get; }
        public FlowDelCommandHandlers(IMapper _Mapper, IFlowServices _services)
        {
            Mapper = _Mapper;
            services = _services;
        }
        /// <summary>
        /// 工艺管理删除
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public async Task<ApiResult<int>> Handle(FlowDelCommand request, CancellationToken cancellationToken)
        {
            return await services.DeleteProcessFlow(request.Id);
        }
    }
}
